<?php


namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Services\FolderService;
use Illuminate\Http\Request;


class FolderController extends Controller
{
    /**
     * @api {post} api/folder/store 创建
     */
    public function store(Request $request, FolderService $service) {
        return $service->store($request->input(), true);
    }

    /**
     * @api {get} api/folder/info/{id} 信息
     */
    public function show(FolderService $service, $id = null) {
        return $service->show($id);
    }

    /**
     * @api {post} api/folder/update/{id} 更新
     */
    public function update(Request $request, FolderService $service, $id = null) {
        return $service->update($id, $request->input());
    }

    /**
     * @api {post} api/folder/destroy 删除
     */
    public function destroy(Request $request, FolderService $service){
        return $service->destroy($request->input('ids'));
    }

    /**
     * @api {get} api/folder/lists 列表
     */
    public function lists(Request $request, FolderService $service) {
        return $service->lists($request->query());
    }
      /**
     * @api {post} api/folder/label/store 创建
     */
    public function storeLabel(Request $request, FolderService $service) {
        return $service->storeLabel($request->input(), true);
    }

    /**
     * @api {post} api/folder/label/update/{id} 更新
     */
    public function updateLabel(Request $request, FolderService $service, $id = null) {
        return $service->updateLabel($id, $request->input());
    }

    /**
     * @api {post} api/folder/label/destroy 删除
     */
    public function destroyLabel(Request $request, FolderService $service){
        return $service->destroyLabel($request->input('ids'));
    }

    /**
     * @api {get} api/folder/label/lists 列表
     */
    public function listsLabel(Request $request, FolderService $service) {
        return $service->listsLabel($request->query());
    }
}
